package com.neusoft.elm.service.impl;


import com.neusoft.elm.dao.PointsDao;

import com.neusoft.elm.dao.impl.PointsDaoImpl;
import com.neusoft.elm.service.PointsService;
import com.neusoft.elm.util.DBUtil;

public class PointsServiceImpl implements PointsService{

	public int updateUserPoint(String userId , Integer point) {
		  PointsDao pointsDao = new PointsDaoImpl();
		  int result = 0;
		try {
			DBUtil.getConnection();
			result = pointsDao.updateUserPoint(userId, point);
		} catch (Exception e) {	
			e.printStackTrace();
		}finally {
			DBUtil.close();
		}
		  return result;
	}
		
	public int getPointById(String userId) {
		PointsDao pointsDao = new PointsDaoImpl();
        int point = 0;
        try {
            DBUtil.getConnection();
            point = pointsDao.getPointById(userId);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            DBUtil.close();
        }
        return point;
    }
		
	}
      

